from random import choice
option = ['石头', '剪刀', '布']
wins     = [['石头', '剪刀'], ['剪刀', '布'], ['布', '石头']]
pwin     = 0
cwin     = 0
prompt   = '''(0) 石头
(1) 剪刀
(2)   布
请出拳：'''

while pwin < 2 and cwin < 2:
    i = int(input(prompt))
    computer = choice(option)
    player = option[i]
    print('你出的:%s, 计算机出的:%s' % (player, computer ))
    if player == computer:
        print('平局')
    elif [player, computer] in wins:
        print('\033[31;42;1mYou Win\033[0m'); pwin += 1
    else:
        print('\033[31;42;1mYou Close\033[0m'); cwin += 1







